﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WorkStation.Frameworks.EasyBus.DbModel;

namespace WorkStation.Frameworks.EasyBus.Repositories
{
    /// <summary>
    /// 消息注册中心仓储接口
    /// </summary>
    public interface IRegisterCenterRepository : IDisposable
    {
        /// <summary>
        /// 获取总线发布信息
        /// </summary>
        /// <param name="busName">总线名称</param>
        /// <returns></returns>
        List<PublishInfo> GetBusPublishInfo(string busName);

        /// <summary>
        /// 获取总线订阅信息
        /// </summary>
        /// <param name="busName">总线名称</param>
        /// <returns></returns>
        List<SubscribeInfo> GetBusSubscribeInfo(string busName);

        /// <summary>
        /// 获取总线监听信息
        /// </summary>
        /// <param name="busName">总线名称</param>
        /// <returns></returns>
        List<ListenerInfo> GetBusListenerInfo(string busName);

        /// <summary>
        /// 获取总线监听信息
        /// </summary>
        /// <param name="busName">总线名称</param>
        /// <param name="nodeName">节点名称</param>
        /// <returns></returns>
        List<ListenerInfo> GetBusListenerInfoByNode(string busName, string nodeName);

        /// <summary>
        /// 删除总线发布信息
        /// </summary>
        /// <param name="busName">总线名称</param>
        void DeleteBusPublishInfo(string busName);

        /// <summary>
        /// 删除总线订阅信息
        /// </summary>
        /// <param name="busName">总线名称</param>
        void DeleteBusSubscribeInfo(string busName);

        /// <summary>
        /// 上传总线的发布信息
        /// </summary>
        /// <param name="info">发布信息集合</param>
        void UploadPublishInfo(List<PublishInfo> info);

        /// <summary>
        /// 上传总线的订阅信息
        /// </summary>
        /// <param name="info">订阅信息集合</param>
        void UploadSubscribeInfo(List<SubscribeInfo> info);

        /// <summary>
        /// 上传总线的监听信息
        /// </summary>
        /// <param name="info">监听信息集合</param>
        void UploadListenerInfo(List<ListenerInfo> info);
    }
}
